﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Routing;
using System.Web.Security;
using System.Web.SessionState;

namespace PCTInterface
{
    public class Global : System.Web.HttpApplication
    {

        protected void Application_Start(object sender, EventArgs e)
        {
            RegisteRoutes(RouteTable.Routes);
        }

        private void RegisteRoutes(RouteCollection routes)
        {
            //其中需要说明的是asp.net 4中使用routes.MapPageRoute方法来添加相应的路由规则.它和.net 3.5 sp1中的routes.add是一样的.只不过更方便些.
            //第一个参数:路由规则名称,用于区别不同的路由规则(随便起)
            //第二个参数:路由规则,{}代表匹配任意,不带{}则表示精确匹配
            //第三个参数:该路由交给那个页面处理,物理页面的路径
           
            routes.MapPageRoute("", "", "~/OtherInterface.aspx");
            routes.MapPageRoute("Query", "Query/{tag}", "~/QueryInterface.aspx", false, new RouteValueDictionary { { "tag", "default" } });
            routes.MapPageRoute("Other", "Other/{tag}", "~/OtherInterface.aspx", false, new RouteValueDictionary { { "tag", "default" } });
            routes.MapPageRoute("Log_1", "LogViewer", "~/Log.aspx", true, new RouteValueDictionary { { "tag", "default" } });

        }

        protected void Session_Start(object sender, EventArgs e)
        {

        }

        protected void Application_BeginRequest(object sender, EventArgs e)
        {

        }

        protected void Application_AuthenticateRequest(object sender, EventArgs e)
        {

        }

        protected void Application_Error(object sender, EventArgs e)
        {

        }

        protected void Session_End(object sender, EventArgs e)
        {

        }

        protected void Application_End(object sender, EventArgs e)
        {

        }
    }
}